#pragma once

#include<iostream>
#include<string>
#include"until.hpp"

namespace NS_LOG
{
    using namespace NS_UNTIL;

    enum{
        Info=0,
        Debug,
        Warning,
        Error,
        Fatal,
    };

     inline std::ostream &Log(const std::string &level, const std::string &file_name, int line)
    {
        //添加等级
        std::string message="[";
        message+=level;
        message+="]";

        //添加文件名
        message+="["+file_name+"]";

        //添加行号
        message+="["+std::to_string(line)+"]";

        //添加时间信息
        message+="["+TimeUntile::GetTimeMess()+"]";
        std::cout <<message;
        return std::cout;
    }

    //缺省参数
    #define LOG(level) Log(#level,__FILE__,__LINE__)

}


